#include "sampledatamodel.h"

//important!
//static member defination
SampleDataModel* SampleDataModel::pInstance = NULL;


SampleDataModel::SampleDataModel(QObject *parent) :
QObject(parent)
{

}

SampleDataModel* SampleDataModel::GetInstance()
{
    if(pInstance ==  NULL)
    {
        pInstance = new SampleDataModel();
    }

    return pInstance;
}

void SampleDataModel::DeleteInstance()
{
    if(pInstance == NULL)
        return;
    else
        delete pInstance;
}

void SampleDataModel::SetBufferDepth(unsigned int depth)
{
    BufferDepth = depth;
    SPIData.resize(BufferDepth);
}

unsigned int SampleDataModel::GetBufferDepth()
{
    return SPIData.size();
}